<include file="Common/Api/header_new" />
<div class="container-fluid">
<include file="Common/Api/left_menu_new" />
  
  <div class="affix container_right">
  
    <div class="title"><a>生成API</a>&nbsp;&gt;&nbsp;<a>数据库</a>&nbsp;&gt;&nbsp;<a>数据类型</a>&nbsp;&gt;&nbsp;输入条件</div>
    
    <div class="container apiadd">
      <form>
          <div class="form-group">
            <label class="apiadd-text">数据源:</label><div class="btn-group">
			  <button class="btn btn-default dropdown-toggle apiadd-select" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
			    选择数据
			    <span class="caret text-right"></span>
			  </button>
			  <ul class="dropdown-menu" aria-labelledby="dropdownMenu1" style="width:100%">
          <foreach name="import_data" item="data">
			     <li role="presentation" class="_data_source_li" data-id="{$data.id}" data-type="{$data.type}"><a href="#">{$data.name}</a></li>
          </foreach>
			  </ul>
			</div>   
          </div>
          
          <div class="form-group">
            <label class="apiadd-text">API&nbsp;名称:</label><input type="text" class="apiadd-input form-control" placeholder="请填写中文名称，用于显示">
          </div>
<script>
$(function () {
  $('[data-toggle="popover"]').popover();
  
  //显示弹出框   $('#identifier').popover('show')
  //隐藏弹出框   $('#identifier').popover('hide')
  //隐藏并销毁   $('#identifier').popover('destroy')
  //详细说明    http://www.runoob.com/bootstrap/bootstrap-popover-plugin.html
})
</script>
          <div class="form-group has-error">
            <label class="apiadd-text">英文名称:</label><input type="text" id="identifier" class="apiadd-input form-control" placeholder="请填写您API地址中的api_name" data-toggle="popover" data-placement="right" data-content="英文名称不能为空">
          </div>
          
          <div class="form-group">
            <label class="apiadd-text textarea-text">API&nbsp;介绍:</label>
            <textarea type="text" class="form-control apiadd-textarea"></textarea>
          </div>
          
          <div class="form-group">
            <label class="apiadd-text">请求方式:</label>
              <div class="btn-group" style="margin-left:20px">
    
                <!-- Inline Radios -->
                <label class="radio inline">
                  <input type="radio" value="1" name="group-fs" checked="checked">POST/GET
                </label>
                <label class="radio inline">
                  <input type="radio" value="2" name="group-fs">POST
                </label>
                <label class="radio inline">
                  <input type="radio" value="2" name="group-fs">GET
                </label>
              </div>
          </div>
          
          <div class="form-group">
            <label class="apiadd-text">返回格式:</label>JOSN
          </div>
          
          <div class="form-group">
            <label class="apiadd-text">授权方式:</label>HTTP Basic Authentication
          </div>

          <div class="form-group">
            <label class="apiadd-text">请求参数:</label><a class="btn btn-info table-add-row _params_opt _params_button">选择字段</a>
            <div class="row">
                <table class="table table-bordered table-striped">
                  <colgroup>
                    <col class="col-md-2">
                    <col class="col-md-1">
                    <col class="col-md-1">
                    <col class="col-md-3">
                    <col class="col-md-4">
                    <col class="col-md-1">
                  </colgroup>
                    <thead>
                    <tr>
                      <th>参数名</th>
                      <th>类型</th>
                      <th>是否必填</th>
                      <th>示例默认值</th>
                      <th>说明</th>
                      <th class="teble-tb-no"></th>
                    </tr>
                    </thead>
                    
                    <tbody>
                        <tr>
                          <td class="padding-3">
                            <input type="text" class="csvadd-input form-control" placeholder="参数名">
                          </td>
                          <td class="padding-3">
                            <div class="btn-group" style="width:100%;">
                              <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width:100%">
                                string
                                <span class="caret"></span>
                              </button>
                              <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
                                <li role="presentation"><a href="#">string</a></li>
                                <li role="presentation"><a href="#">string</a></li>
                              </ul>
                            </div>   
                          </td>
                          <td class="padding-3">
                          
                            <div class="btn-group" style="width:100%;">
                              <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width:100%">
                                是
                                <span class="caret"></span>
                              </button>
                              <ul class="dropdown-menu" aria-labelledby="dropdownMenu2">
                                <li role="presentation"><a href="#">是</a></li>
                                <li role="presentation"><a href="#">否</a></li>
                              </ul>
                            </div>   
                          </td>
                          <td class="padding-3">
                            <input type="text" class="csvadd-input form-control" placeholder="说明说明说明说明说明说明说明">
                          </td>
                          <td class="padding-3">
                            <input type="text" class="csvadd-input form-control" placeholder="说明说明说明说明说明说明说明">
                          </td>
                          <td class="teble-tb-no text-left"><a onclick="deleteTr(this);">删除</a></td>
                        </tr>
                    </tbody>
                    
                  </table>
            </div>
          </div>
          
          <div class="form-group">
            <label class="apiadd-text">返回字段:</label><a class="btn btn-info table-add-row _return_field_button">选择字段</a>
            <div class="row">
                <table class="table table-bordered table-striped">
                  <colgroup>
                    <col class="col-md-3">
                    <col class="col-md-2">
                    <col class="col-md-1">
                    <col class="col-md-5">
                    <col class="col-md-1">
                  </colgroup>
                    <thead>
                    <tr>
                      <th>字段名</th>
                      <th>nickname</th>
                      <th>类型</th>
                      <th>说明</th>
                      <th class="teble-tb-no"></th>
                    </tr>
                    </thead>
                    
                    <tbody>
                    
                        <tr>
                          <td class="padding-3">
                            <input type="text" class="csvadd-input form-control" placeholder="字段名">
                          </td>
                          <td class="padding-3">
                            <input type="text" class="csvadd-input form-control" placeholder="nickname">
                          </td>
                          <td class="padding-3">
                          
                            <div class="btn-group" style="width:100%;">
                              <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu3" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width:100%">
                                string
                                <span class="caret"></span>
                              </button>
                              <ul class="dropdown-menu" aria-labelledby="dropdownMenu3">
                                <li role="presentation"><a href="#">string</a></li>
                                <li role="presentation"><a href="#">string</a></li>
                              </ul>
                            </div>    
                              
                          </td>
                          <td class="padding-3">
                            <input type="text" class="csvadd-input form-control" placeholder="说明说明说明说明说明说明说明">
                          </td>
                          <td class="teble-tb-no text-left"><a onclick="deleteTr(this);">删除</a></td>
                        </tr>
                        
                       
                    </tbody>
                    
                  </table>
            </div>
          </div>
          
          <div class="form-group">
            <label class="apiadd-text">JSON返回示例:</label>
            <div class="row">
                <div class="col-md-11"><textarea type="text" class="form-control apiadd-textarea-json"></textarea></div>
                <div class="col-md-1"></div>
            </div>
          </div>
          
          <div class="form-group">
            <label class="apiadd-text">返回字段:</label>
            <div class="row">
                <table class="table table-bordered table-striped" id="tab1">
                  <colgroup>
                    <col class="col-md-3">
                    <col class="col-md-4">
                    <col class="col-md-4">
                    <col class="col-md-1">
                  </colgroup>
                    <thead>
                    <tr>
                      <th>错误码</th>
                      <th>错误信息</th>
                      <th>错误码返回说明</th>
                      <th class="teble-tb-no"></th>
                    </tr>
                    </thead>
                    
                    <tbody>
                    
                        <tr>
                          <td class="padding-3">
                            <input type="text" class="csvadd-input form-control">
                          </td>
                          <td class="padding-3">
                            <input type="text" class="csvadd-input form-control">
                          </td>
                          <td class="padding-3">
                            <input type="text" class="csvadd-input form-control">
                          </td>
                          <td class="teble-tb-no text-left"><a onclick="deleteTr(this);">删除</a></td>
                        </tr>
                        
                        
                       
                    </tbody>
                    
                  </table>
                  <a class="btn btn-info table-add-row" onclick="addTr1('tab1', -1)">添加字段</a>
            </div>
          </div>
          
          <div class="form-group">
            <label class="apiadd-text">数据更新类型:</label>
              <div class="btn-group" style="margin-left:20px">
    
                <!-- Inline Radios -->
                <label class="radio inline">
                  <input type="radio" value="1" name="group-top" checked="checked">实时更新
                </label>
                <label class="radio inline">
                  <input type="radio" value="2" name="group-top">静态数据
                </label>
              </div>
          </div>
          <div class="form-group">
            <button type="submit"  class="btn btn-primary text-left">确认</button>
          </div>
       </form>
    </div>
    
    
  </div>
</div>



<div class="modal fade bs-example-modal-detail-apiadd-add1" id="params_content" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"></div>
  <script  id="params_list_template" type="text/html">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-body text-center">
       <table class="table table-bordered">
          <colgroup>
            <col class="col-md-2">
            <col class="col-md-10">
          </colgroup>
            <thead>
            <tr>
              <th></th>
              <th>字段名</th>
            </tr>
            </thead>
            
            <tbody>
            
                <tr>
                  <td class="padding-35">
                    <label>
                      <input  class="_params_td" type="checkbox" checked="checked" value="1" name="checkbox">
                    </label>
                  </td>
                  <td><a>1</a></td>
                </tr>
            
               
            </tbody>
            
          </table>
      </div>
      <div class="modal-footer">
       <div class="row text-center">
        <button type="button" class="btn btn-primary" data-dismiss="modal">确定</button>
       </div>
      </div>
    </div>
  </div>
  </script>

<div class="modal fade bs-example-modal-detail-apiadd-add2" id="return_field_content" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabe1"></div>
  <script  id="return_field_list_template" type="text/html">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-body text-center">
       <table class="table table-bordered">
          <colgroup>
            <col class="col-md-2">
            <col class="col-md-10">
          </colgroup>
            <thead>
            <tr>
              <th></th>
              <th>字段名</th>
            </tr>
            </thead>
            
            <tbody>
            
                <tr>
                  <td class="padding-35">
                    <label>
                      <input class="_return_field_td" type="checkbox" checked="checked" value="1" name="checkbox">
                    </label>
                  </td>
                  <td><a>1</a></td>
                </tr>
            
               
            </tbody>
            
          </table>
                </div>
      <div class="modal-footer">
       <div class="row text-center">
        <button type="button" class="btn btn-primary" data-dismiss="modal">确定</button>
       </div>
      </div>
    </div>
  </div>
  </script>

<input type="hidden" value="" class="_source_id" />
<input type="hidden" value="" class="_source_type" />
<script type="text/javascript" src="__PUBLIC__/home/js/artTemplate.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript" src="__PUBLIC__/home/js/madd.js"></script>
</body>
</html>
